package mc

import (
	"gitee.com/dreamwood/ez-go/db/mgo"
)

const (
	UserEventNew          = "syncs.UserNew"
	UserEventBeforeCreate = "syncs.UserBeforeCreate"
	UserEventBeforeUpdate = "syncs.UserBeforeUpdate"
	UserEventBeforeSave   = "syncs.UserBeforeCreate syncs.UserBeforeUpdate"
	UserEventAfterCreate  = "syncs.UserAfterCreate"
	UserEventAfterUpdate  = "syncs.UserAfterUpdate"
	UserEventAfterSave    = "syncs.UserAfterCreate syncs.UserAfterUpdate"
	UserEventDelete       = "syncs.UserDelete"
)

func GetUserConfig() *mgo.DocConfig {
	return User_Config
}

var User_Config *mgo.DocConfig

func init() {
	User_Config = NewUserConfig()
}
func NewUserConfig() *mgo.DocConfig {
	return &mgo.DocConfig{
		ContainerKey: "syncs.User",
		Fields: []string{
			"account", "password", "salt", "token", "pic", "name", "code", "phone", "idCard", "sex", "age",
		},
		RelationFields:  []string{},
		RelationConfigs: map[string]*mgo.DocRelation{},
		FieldFilter: map[string]*mgo.DocFieldFilter{
			"default": {
				Select: []string{},
				Omit:   []string{},
			},
		},
	}
}
